<?php
declare (strict_types = 1);

namespace app\controller\admin;

use app\BaseController;
use think\facade\Filesystem;
use think\helper\Str;
use think\Request;

class ToolController extends BaseController
{
    public function uploadFile(Request $request)
    {
        $file = $request->file('file');
        $saveName = Filesystem::disk('public')->putFile('uploads/images',$file);
        $saveName = str_replace("\\",'/',$saveName);
        return $this->success(sprintf('%s/storage/%s',env('APP_HOST'),$saveName));
    }
}
